#include "ThreadPool.hpp"

using namespace ThreadPoolModual;
using task_t = function<void()>;
void func()
{
    sleep(1);
}
int main()
{
    ENABLE_CONSOLE_LOG_STRATEGY();
    // ENABLE_FILE_LOG();
    int cnt = 10;
    while (cnt)
    {
        ThreadPool<task_t>::GetInstance()->Enqueue(func);
        cnt--;
    }
    ThreadPool<task_t>::GetInstance()->Stop();
    ThreadPool<task_t>::GetInstance()->Wait();
    // std::unique_ptr<ThreadPool<task_t>> tp = std::make_unique<ThreadPool<task_t>>();
    // tp->Start();

    // int cnt = 10;
    // char c;
    // while (cnt)
    // {
    //     tp->Enqueue(func);
    //     cnt--;
    //     sleep(1);
    // }

    // tp->Stop();
    // tp->Wait();

    return 0;
}